<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]
namespace think;

// 加载基础文件
require __DIR__ . '/../thinkphp/base.php';

// 全局常量
define('EXT', '.php');
define('DS', DIRECTORY_SEPARATOR);
define('ROOT_PATH', dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . DS);
define('APP_PATH', ROOT_PATH . 'application' . DS);
define('RUNTIME_PATH', ROOT_PATH . 'runtime' . DS);
define('LOG_PATH', RUNTIME_PATH . 'log' . DS);
define('CACHE_PATH', RUNTIME_PATH . 'cache' . DS);
define('TEMP_PATH', RUNTIME_PATH . 'temp' . DS);
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] != 'off') ? 'https' : 'http';
define('SITE_URL',$http.'://'.$_SERVER['HTTP_HOST']); // 网站域名
define('PUBLIC_ROOT', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME'])));

// 支持事先使用静态方法设置Request对象和Config对象

// 执行应用并响应
Container::get('app')->run()->send();
